<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/22
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册</title>
</head>
<style type="text/css">
    body{
        background:url(websources/be.jpg) no-repeat;
        width:100%;
        height:100%;
        overflow:hidden;
        background-size:cover;
    }
    table{
        margin:0 auto;
        margin-top:80px;
        font-size:20px;
        font-family:"宋体";
        opacity: 0.8;
    }
    .Check1{
        font-size:20px;
        font-family:"宋体";
        width: 80px;
        height: 40px;
    }
    .login{
        font-size:25px;
        font-family:"宋体";

    }
    input{
        border-radius:10px;

    }
    .input1{
        border-radius:10px;
        height: 40px;
        width: 200px;
    }
    .biaoti{
        text-align: center;
        font-size: 70px;
        font-family: "宋体";
        line-height: 100px;
    }
</style>
<script language="javascript" >
    function msg()
    {
        if(form1.pass1.value!=form1.pass2.value)
        {
            alert("两次密码输入不一致");
            form1.pass1.value="";
            form1.pass2.value="";
            form1.pass1.focus();
        }
    }
    function rng()
    {
        var number;
        var i;
        var str2;
        var str="";
        p0.innerHTML="";
        var picture=new Array(4);
        picture[0]='1';
        picture[1]='2';
        picture[2]='3';
        picture[3]='4';
        for(i=0;i<4;i++)
        {
            number=Math.floor(Math.random()*4);
            p0.innerHTML=p0.innerHTML+"<img src='${pageContext.request.contextPath }/websources/"+(number+1)+".gif'/>";
            str=str+picture[number];
        }

        t=parseInt(str);
    }
    function get()
    {
        document.getElementById("p0").style.display="block";
        document.getElementById("p1").style.display="block";
        document.getElementById("p2").style.display="block";
        document.getElementById("p3").style.display="block";
        document.getElementById("p4").style.display="block";
        var number;
        var i;
        var str2;
        var str="";
        p0.innerHTML="";
        var picture=new Array(4);
        picture[0]='1';
        picture[1]='2';
        picture[2]='3';
        picture[3]='4';
        for(i=0;i<4;i++)
        {
            number=Math.floor(Math.random()*4);
            p0.innerHTML=p0.innerHTML+"<img src='"+(number+1)+".gif'/>";
            str=str+picture[number];
        }
        t=parseInt(str);
    }
    function skt()
    {
        if(form1.check.value!=t)
        {
            alert("验证码错误，请重新输入");
            form1.check.value="";
            form1.check.focus();
            return false;
        }
        return true;
    }
   /* function b()
    {
        var str=form1.username.value;
        location.href="Checkname.php?x="+str;
    }*/


</script>
<body>
<form action="user/register" method="post" id="form1"  onsubmit="return skt()">
    <div class="biaoti";style="width: 500px;height: 20px;">欢迎注册</div>
    <table  width="550" height="700" border="0"  cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">

        <tr height="25">
            <td width="144" height="57" align="right">账号id：</td>
            <td width="156" ><input type="text" size="15" name="id" id="id" required="required"  style="width:170px;height:40px" onblur="b()" /></td></tr>
        <tr ><td width="144" height="39" align="right" >姓名：</td><td width="156" ><input type="text" size="15" name="name" id="name" required="required" style="width:170px;height:40px"/></td></tr>
        <tr><td width="144" height="32" align="right">密码：</td><td width="156" ><input type="password" size="15" name="password" id="password" required="required" style="width:170px;height:40px"/></td></tr>
        <tr><td width="144" height="36" align="right">确认密码：</td><td width="156" ><input type="password" size="15" name="configpassword" id="configpassword" required="required"   onblur="msg()" style="width:170px;height:40px" /> </td></tr>
        <tr><td width="144" height="20" align="right">性别：</td><td width="156"  ><input type="radio" name="sex" id="sex" value="男"/> 男<input type="radio" name="sex" value="女" />女</td></tr>
        <tr><td width="144" height="36" align="right">联系方式：</td><td width="156" ><input type="text" name="tel" size="18" id="tel" style="width:170px;height:40px" /></td></tr>
        <tr ><td width="144" height="39" align="right" >验证码：</td>
            <td width="156">
                <input type="text" name="check" size="7" id="check"  class="Check1" />&nbsp;
                <input type="button" class="Check1" name="get1" id="get1" value="验证码" onclick="get()"
                /></td></tr>
        <tr ><td width="144" height="31" id="s0" ></td>
            <td width="156" height="31">
                <div id="p0" onclick="rng()">
                    <div id="p1" ></div>
                    <div id="p2" onclick="rng()"></div>
                    <div id="p3" onclick="rng()"></div>
                    <div id="p4" onclick="rng()"></div>
                </div>
            </td>
        </tr>
        <tr><td width="144" height="20"></td><td width="156" ><input type="submit" name="Submit" id="Submit" value="注册" class="login"  style="width:170px;height:40px;font-size:18px" /></td></tr>
    </table>
</form>
</body>
</html>
